package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Vector2;
import com.corona.Game;
import com.corona.game.util.TextureCache;
import java.util.ArrayList;

/* compiled from: Battle.java */
/* access modifiers changed from: package-private */
/* loaded from: pokewilds.jar:com/pkmngen/game/CatchPokemonWobbles3Times.class */
public class CatchPokemonWobbles3Times extends Action {
    ArrayList<Sprite> sprites;
    Sprite sprite;
    ArrayList<Integer> repeats;
    String sound;
    ArrayList<String> sounds;
    ArrayList<Float> alphas;
    public Action.Layer layer = Action.Layer.gui_120;
    Vector2 position = new Vector2(114.0f, 88.0f);
    ArrayList<Vector2> positions = new ArrayList<>();

    public CatchPokemonWobbles3Times(Game game, Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        TextureCache.get(Gdx.files.internal("pokeball1_color.png"));
        this.positions.add(new Vector2(0.0f, 0.0f));
        this.positions.add(new Vector2(-1.0f, 0.0f));
        this.positions.add(new Vector2(1.0f, 0.0f));
        this.positions.add(new Vector2(1.0f, 0.0f));
        for (int i = 0; i < 2; i++) {
            this.positions.add(new Vector2(-1.0f, 0.0f));
            this.positions.add(new Vector2(-1.0f, 0.0f));
            this.positions.add(new Vector2(1.0f, 0.0f));
            this.positions.add(new Vector2(1.0f, 0.0f));
        }
        this.positions.add(new Vector2(-19.0f, -16.0f));
        for (int i2 = 0; i2 < 6; i2++) {
            this.positions.add(new Vector2(0.0f, 0.0f));
        }
        this.sprites = new ArrayList<>();
        this.sprites.add(null);
        Texture text = TextureCache.get(Gdx.files.internal("pokeball_wiggleSheet1_color.png"));
        this.sprites.add(new Sprite(text, 0, 0, 12, 12));
        this.sprites.add(new Sprite(text, 12, 0, 12, 12));
        this.sprites.add(new Sprite(text, 0, 0, 12, 12));
        this.sprites.add(new Sprite(text, 24, 0, 12, 12));
        this.sprites.add(new Sprite(text, 0, 0, 12, 12));
        this.sprites.add(new Sprite(text, 12, 0, 12, 12));
        this.sprites.add(new Sprite(text, 0, 0, 12, 12));
        this.sprites.add(new Sprite(text, 24, 0, 12, 12));
        this.sprites.add(new Sprite(text, 0, 0, 12, 12));
        this.sprites.add(new Sprite(text, 12, 0, 12, 12));
        this.sprites.add(new Sprite(text, 0, 0, 12, 12));
        this.sprites.add(new Sprite(text, 24, 0, 12, 12));
        Texture text2 = TextureCache.get(Gdx.files.internal("poof_sheet1.png"));
        this.sprites.add(new Sprite(text2, 0, 0, 48, 48));
        this.sprites.add(new Sprite(text2, 48, 0, 48, 48));
        this.sprites.add(new Sprite(text2, 96, 0, 48, 48));
        this.sprites.add(new Sprite(text2, 144, 0, 48, 48));
        this.sprites.add(new Sprite(text2, 192, 0, 48, 48));
        this.sprites.add(null);
        this.repeats = new ArrayList<>();
        this.repeats.add(12);
        this.repeats.add(43);
        for (int i3 = 0; i3 < 3; i3++) {
            this.repeats.add(3);
        }
        this.repeats.add(43);
        for (int i4 = 0; i4 < 3; i4++) {
            this.repeats.add(3);
        }
        this.repeats.add(43);
        for (int i5 = 0; i5 < 2; i5++) {
            this.repeats.add(3);
        }
        this.repeats.add(13);
        for (int i6 = 0; i6 < 4; i6++) {
            this.repeats.add(4);
        }
        this.repeats.add(9);
        this.repeats.add(3);
        this.sounds = new ArrayList<>();
        this.sounds.add("pokeball_wiggle1");
        this.sounds.add(null);
        this.sounds.add("pokeball_wiggle1");
        for (int i7 = 0; i7 < 3; i7++) {
            this.sounds.add(null);
        }
        this.sounds.add("pokeball_wiggle1");
        for (int i8 = 0; i8 < 6; i8++) {
            this.sounds.add(null);
        }
        this.sounds.add("poof1");
        for (int i9 = 0; i9 < 5; i9++) {
            this.sounds.add(null);
        }
        this.alphas = new ArrayList<>();
        for (int i10 = 0; i10 < 18; i10++) {
            this.alphas.add(Float.valueOf(0.0f));
        }
        this.alphas.add(Float.valueOf(1.0f));
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.positions.isEmpty() || this.sprites.isEmpty()) {
            game.insertAction(new DisplayText(game, "Shoot! It was so close, too!", (String) null, (Action) null, this.nextAction));
            game.actionStack.remove(this);
            return;
        }
        if (this.alphas.get(0).floatValue() == 0.0f) {
            DrawBattle.shouldDrawOppPokemon = false;
        } else {
            DrawBattle.shouldDrawOppPokemon = true;
        }
        this.sound = this.sounds.get(0);
        if (this.sound != null) {
            game.insertAction(new PlaySound(this.sound, (Action) null));
            this.sounds.set(0, null);
        }
        this.sprite = this.sprites.get(0);
        if (this.sprite != null) {
            this.sprite.setPosition(this.position.x, this.position.y);
            this.sprite.draw(game.uiBatch);
        }
        if (this.repeats.get(0).intValue() > 0) {
            this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
            return;
        }
        this.position = this.position.add(this.positions.get(0));
        this.positions.remove(0);
        this.sprites.remove(0);
        this.repeats.remove(0);
        this.sounds.remove(0);
        this.alphas.remove(0);
    }
}
